home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- ### BEGIN INIT INFO
- # Provides: tails-kexec
- # Required-Start:
- # Required-Stop: halt reboot
- # X-Stop-After: umountroot live-boot
- # Default-Start:
- # Default-Stop: 0 6
- # X-Interactive: true
- # Short-Description: Execute the kexec -e command to reboot system
- # Description:
- ### END INIT INFO
-
- # FIXME: this script should be translatable in a better way than the
- # ugly case..esac thing. Note that using gettext at this point -i.e.
- # after the DVD has been ejected- is probably too brittle. A possible
- # solution would be to turn this script into a .in file, with
- # placeholders for translatable string. Translatable strings and their
- # translations could be managed by ikiwiki+po, and the placeholders
- # could be replaced at boot time -depending on the chosen locale- by
- # the appropriate strings. Unfortunately po4a does not support shell
- # scripts.
-
- PATH=/sbin:/bin
-
- print_text () {
- echo "$1" > /dev/console
- }
-
- print_empty_line () {
- print_text ''
- }
-
- do_stop () {
- test "x`/bin/cat /sys/kernel/kexec_loaded`y" = "x1y" || exit 0
-
- /bin/stty sane < /dev/console
-
- print_empty_line
- print_empty_line
- print_text "--------------------------------------------------------------------------------"
-
- # $LANG was set there by the FIXME live-config upstream script
- . /etc/default/locale
-
- # Note to translators: any text line must fit on a 80 characters wide screen
- case "${LANG}" in
- es_ES.UTF-8)
- print_text " Puede ahora retirar el DVD o el USB de arranque."
- print_empty_line
- print_text " Se borrará dentro de pocos segundos la memoria RAM del sistema..."
- print_empty_line
- print_text "Pueden aparecer problemas de visualizaci├│n en el monitor durante esta operaci├│n."
- print_empty_line
- print_text " If the system does not power off automatically in a few seconds,"
- print_text " it may mean the memory wiping has failed."
- ;;
- fr_FR.UTF-8)
- print_text " Vous pouvez maintenant retirer le DVD / clé USB de boot."
- print_empty_line
- print_text " La mémoire vive va être effacée dans quelques secondes..."
- print_empty_line
- print_text " Il est possible que l'affichage soit corrompu au cours de cette opération."
- print_empty_line
- print_text " Si l'ordinateur ne s'éteint pas automatiquement après quelques secondes,"
- print_text " il est possible que l'effacement de la mémoire ait échoué."
- ;;
- it*)
- print_text " Adesso puoi rimuovere il cd o la penna USB."
- print_empty_line
- print_text " La memoria del computer verra' cancellata tra pochi secondi..."
- print_empty_line
- print_text " Il display potra' essere corrotto durante questa operazione."
- print_empty_line
- print_text " Se vostro PC non si spegnera' automaticamente in pochi secondi"
- print_text " la cancellazione della memoria putrebbe essere incompleta."
-
- ;;
- *)
- print_text " You can now remove the boot DVD or USB stick."
- print_empty_line
- print_text " The system memory is going to be wiped in a few seconds..."
- print_empty_line
- print_text " Display might be corrupted during this operation."
- print_empty_line
- print_text " If the system does not power off automatically in a few seconds,"
- print_text " it may mean the memory wiping has failed."
- ;;
- esac
-
- print_text "--------------------------------------------------------------------------------"
- print_empty_line
- print_empty_line
-
- /bin/sleep 5
- /sbin/kexec -e --reset-vga
- }
-
- case "$1" in
- start)
- # No-op
- ;;
- restart|reload|force-reload)
- echo "Error: argument '$1' not supported" >&2
- exit 3
- ;;
- stop)
- do_stop
- ;;
- *)
- echo "Usage: $0 start|stop" >&2
- exit 3
- ;;
- esac
- exit 0
-